import java.util.Scanner;
public class sushu {
    public static void main(String[] args) {
        //判断一个数是否是素数素数 试除法
        Scanner scanner = new Scanner(System.in);
        while (true) {
            System.out.println("请输入一个数:");
            if (!scanner.hasNextInt()) {
                break;
            }
            int num = scanner.nextInt();
            if (num < 2) {
                System.out.println(num + "不是素数");
            } else {
                int i = 2;
                for (; i <= num - 1; i++) {
                    if (num % i == 0) {
                        break;
                    }
                }
                // 两种情况会跳出循环 1.i>num 2.遇到break
                if (i > num - 1) {
                    System.out.println(num + "是素数");
                } else {
                    System.out.println(num + "不是素数");
                }
            }
        }
    }
}
